#include<stdio.h>
int main() {
	int n=0;
	scanf_s("%d", &n);
	int ret = 1;
	for (int i = 1, sum = 1; i < n + 1; i++) {
		sum *= i;
		printf("%d%s%d%s ", i ,"!= ",sum,"\n");
		ret += sum;		
	}
	printf("%s%d","\n", ret);
	return 0;
}